/******************************************************************
 * @version      : 1.0
 * @Author       : zhl
 * @Date         : 2023-02-13 14:05:39
 * @LastEditors  : zhl
 * @E-Mail       : zhll168@163.com
 * @Description  : 提供网关操作的相应接口
 ******************************************************************/
#ifndef __GW_MANAGER_H__
#define __GW_MANAGER_H__
#include "gpio.h"
#include <unistd.h>

#ifdef __cplusplus
extern "C"{
#endif

extern int gw_write_coil(int reg_addr, uint8_t data);
extern int gw_write_coils(int reg_addr, int n, uint8_t *data);
extern int gw_write_register(int reg_addr, uint16_t data);
extern int gw_write_registers(int reg_addr, int n, uint16_t *data);

extern int gw_read_coil(int reg_addr, uint8_t &data);
extern int gw_read_coils(int reg_addr, int n, uint8_t *data);
extern int gw_read_register(int reg_addr, uint16_t &data);
extern int gw_read_registers(int reg_addr, int n, uint16_t *data);


#ifdef __cplusplus
}
#endif


#endif /*__GW_MANAGER_H__*/